package com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.maintenancesystem.basisinfo;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseService;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.utils.requestutil.HttpRequestUtil;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.check.businessseat.BusinessSeatService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;


/**
 * @Author: YangYu
 * @ClassName: OrganizationMaintenanceService
 * @Date: Created in 14:39 2020/12/22
 * @Description: 维保机构服务
 */
@Service
@Slf4j
public class OrganizationMaintenanceService extends BaseService {

    private static final Logger logger = LoggerFactory.getLogger(BusinessSeatService.class);
    /**
     * @Author YangYu
     * @Description 维保机构分页列表
     * @Date Created in 16:38 2020/12/22
     * @Param [jsonParam]
     */

    public RespEntity organizationMaintenancePagList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","organizationMaintenancePagList","organizationMaintenance");
    }

    /**
     * @Author YangYu
     * @Description 维保机构新增
     * @Date Created in 13:54 2020/12/24
     * @Param [jsonParam]
     */

    public RespEntity add(JSONObject jsonParam){
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","add","organizationMaintenance");
    }

    /**
     * @Author YangYu
     * @Description 维保机构更新
     * @Date Created in 13:56 2020/12/24
     * @Param [jsonParam]
     */

    public RespEntity update(JSONObject jsonParam){
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","update","organizationMaintenance");
    }

    /**
     * @Author YangYu
     * @Description 维保详情
     * @Date Created in 13:57 2020/12/24
     * @Param [jsonParam]
     */

    public RespEntity detail(JSONObject jsonParam){
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","detail","organizationMaintenance");
    }

    /**
     * @Author YangYu
     * @Description 删除维保机构
     * @Date Created in 14:02 2020/12/24
     * @Param [jsonParam]
     */

    public RespEntity delete(JSONObject jsonParam){
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","delete","organizationMaintenance");
    }
}
